#include "timerfd.h"
#include "error.h"

#include <sys/timerfd.h>

int Wrap::tfd_nonblock() {
    return TFD_NONBLOCK;
}

int Wrap::tfd_cloexec() {
    return TFD_CLOEXEC;
}

int Wrap::timerfd_create_(int clock_id, int flags) {
    return PERROR_NEG(::timerfd_create(clock_id, flags));
}

int Wrap::timerfd_settime_(
    int ufd, int flags, const struct itimerspec *utmr, struct itimerspec *otmr) {
    return PERROR_NEQ0(::timerfd_settime(ufd, flags, utmr, otmr));
}
